<?php
include("./API.php");
include("../config.php");
tongji("qun_clw");
$qq=$_GET['qq'];//登录者的QQ号
$skey=$_GET['skey'];//登录者的skey
$pskey=$_GET['pskey'];//登录者的pskey(qun.qq.com)
$gc=$_GET['gc'];//操作群号
$hh=$_REQUEST['hh']?:"\n";//换行符号(默认\n)
$url='https://qun.qq.com/interactive/honorlist?gc='.$gc.'&type=1&_wv=3&_wwv=129';
$cookie='p_skey='.$pskey.'; uin=o'.$qq.'; skey='.$skey.'; p_uin=o'.$qq.';';
$data=get_result($url,$cookie);
preg_match_all("/<span>蝉联(.*?)<\/span>/",$data,$ts);
preg_match_all('/{"uin":(.*?),"/',$data,$zh);
$ts=$ts[1][0];//蝉联
$zh=$zh[1][0];//账号
preg_match_all('/{"uin":'.$zh.',"avatar":"(.*?)","name":"(.*?)",/',$data,$name);
$name=$name[2][0];//昵称
if($ts=="天"and$name==""){
echo "".$web["ming"]."API♧QQ群龙王查询".$hh."";
echo "━━━━━━━━━".$hh."";
echo "查询失败，请检查key是否失效!".$hh."";
echo "━━━━━━━━━".$hh."";
echo "Tips:".$web["ming"]."API技术支持";
}else if($ts=="天"){
echo "".$web["ming"]."API♧QQ群龙王查询".$hh."";
echo "━━━━━━━━━".$hh."";
echo "昵称：虚位以待".$hh."";
echo "账号：虚位以待".$hh."";
echo "蝉联：虚位以待".$hh."";
echo "━━━━━━━━━".$hh."";
echo "Tips:".$web["ming"]."API技术支持";
}else{
echo "".$web["ming"]."API♧QQ群龙王查询".$hh."";
echo "━━━━━━━━━".$hh."";
echo "昵称：".$name."".$hh."";
echo "账号：".$zh."".$hh."";
echo "蝉联：".$ts."".$hh."";
echo "━━━━━━━━━".$hh."";
echo "Tips:".$web["ming"]."API技术支持";
}

function get_result($url,$cookie)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$header = array('user-agent: Mozilla/5.0 (Linux; Android 7.1.2; Redmi 4X Build/N2G47H; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/045806 Mobile Safari/537.36 V1_AND_SQ_8.8.20_1976_YYB_D A_8082000 QQ/8.8.20.5865 NetType/WIFI WebP/0.3.0 Pixel/720 StatusBarHeight/51 SimpleUISwitch/0 QQTheme/1000 InMagicWin/0 StudyMode/0 CurrentMode/0 CurrentFontScale/1.0');
//curl_setopt($ch,CURLOPT_POST,true);
//curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3); //设置等待时间
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //设置cURL允许执行的最长秒数
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); 
curl_setopt($ch, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}

?>